/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package netexpwithoutui;

import domains.Users;
import java.util.List;

/**
 *
 * @author hxd
 */
public class NetExpWithoutUI {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        List<Users> list = Factory.DbService.select("from Users where name='aaa'");
        System.out.println(list.size());
        Users user = list.get(0);
        //System.out.println(user.getName() + user.getPwd());
        //Users newuser=new Users("wm","hxd");
        // Factory.DbService.insert(newuser);
        //user.setName("wife");
        Factory.DbService.update(user);
    }

    public static boolean login(String LoginName,String pwd) {
                Users user=Factory.DbService.getUser(LoginName);
                if(user.getPwd().equals(pwd)){
                    return true;
                }else{
                    return false;
                }
    }
}
